#include"mystdio.h"
#define FILENAME "log.txt"
#include<string.h>
#include<stdio.h>
#include<unistd.h>
int main()
{
    MyFile* fp = my_fopen(FILENAME,"w");
    if(fp == NULL) return 1;
    const char* mesg = "hello mystdio";
    int cnt = 10;
    char buf[128];
    while(cnt)
    {
        sprintf(buf,"%s -- %d",mesg,cnt);
        MyFwrite(fp,buf,strlen(buf));
        --cnt;
        sleep(1);
    }
    My_fclose(fp);
    return 0;
}
